library SSXU02;

uses
  SysUtils,
  Classes,
  Forms,
  Windows,
  uLoginMegaBuy in 'uLoginMegaBuy.pas';

{$R *.res}
//var DllApp : TApplication;

procedure MegaBuyLogin(MainApp: TApplication; userLogin, userPassword,
   salesPerson: PChar); stdcall;
var
  MBL : TMBLogin;
begin
{  if not Assigned(DllApp) then begin
    DllApp := Application;
    Application := MainApp;
  end;
  MBL := TMBLogin.Create(Application);  }
  //MBL := TMBLogin.Create(MainApp);
  MBL := TMBLogin.Create(nil);
  try
    MBL.SetParam(StrPas(userLogin), StrPas(userPassword),
      StrPas(salesPerson));
    MBL.ShowWeb; 
  finally
    MBL.Free;
  end;
end;

{procedure MyDLLProc(Reason : Integer);
begin
  if Reason = DLL_PROCESS_DETACH then
  if Reason = 0 then begin
    if Assigned(DllApp) then
      Application := DllApp;
  end;
end;  }

exports
  MegaBuyLogin;
  
begin

end.
